package com.my.cd.strategy;

/**
 * 主测试类
 */
public class MainTest {

    public static void main(String[] args) {

        Duck mGreenHeadDuck = new GreenHeadDuck();
        Duck mRedHeadDuck = new RedHeadDuck();

        mGreenHeadDuck.display();
        mGreenHeadDuck.fly();
        mGreenHeadDuck.quack();
        mGreenHeadDuck.swim();

        mRedHeadDuck.display();
        mRedHeadDuck.fly();
        mRedHeadDuck.quack();
        mRedHeadDuck.swim();
        mRedHeadDuck.display();
        mRedHeadDuck.setFlyBehavoir(new NoFlyBehavior());
        mRedHeadDuck.fly();
        mRedHeadDuck.setQuackBehavoir(new NoQuackBehavior());
        mRedHeadDuck.quack();
    }

}
